package com.example.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 信用积分变更记录表
 * @TableName credit_score_log
 */
@TableName(value ="credit_score_log")
@Data
public class CreditScoreLog implements Serializable {
    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 用户ID，仅逻辑关联用户表
     */
    @TableField(value = "user_id")
    private Integer userId;

    /**
     * 变更类型：加分/扣分
     */
    @TableField(value = "change_type")
    private String changeType;

    /**
     * 变更值（正负数）
     */
    @TableField(value = "change_value")
    private Integer changeValue;

    /**
     * 变更原因说明
     */
    @TableField(value = "reason")
    private String reason;

    /**
     * 操作人ID（管理员ID，逻辑关联）
     */
    @TableField(value = "operator_id")
    private Long operatorId;

    /**
     * 记录创建时间
     */
    @TableField(value = "create_time")
    private Date createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;



    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", user_id=").append(userId);
        sb.append(", change_type=").append(changeType);
        sb.append(", change_value=").append(changeValue);
        sb.append(", reason=").append(reason);
        sb.append(", operator_id=").append(operatorId);
        sb.append(", create_time=").append(createTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}